<?php
use Think\Controller;
abstract class Ac extends Controller{

	public $fc = "";	
	public function __construct(){
		parent::__construct();
		$this->fc = array_merge($_POST,$_GET);
		if(!Csession()){
			echo '<script type="text/javascript">window.top.location="http://'.$_SERVER['SERVER_NAME'].'";</script>';
			exit();
		}
	}
	
	/* 公共导航部分 */
	public function navigation($r=""){  
	   $nav = $this->getNav();		  	     
	   $strlen = strlen($r);
	   for($i=0;$i<$strlen;$i++){
		  $rt =  mb_substr($r, 0, $strlen-$i);
		  $arr[] = $nav[$rt];   
	   }
	   $arr = array_reverse($arr);	   
	   foreach($arr as $k=>$v){
		  if($k!=0) $res .= " -> ";
		  $url = !empty($v['url']) ? ' href="'.__APP__.'/'.$v['url'].'"' : '';
		  $res .= '<a class="blueunder"'.$url.'>'.$v['name']."</a>";   
	   }
	   
	   $data['nav'] = $res;
	   if($strlen!=1){
		 $rt =  mb_substr($r, 0, $strlen-1);  
	   	 $data['lasturl'] = __APP__.$nav[$rt]['url'];
	   }
	   return $data;			  			  		  	  		
   }	
   	
}